Skip to content

fix(voice): keep realtime turn after chat ctx timeout#2083

Open
rosetta-livekit-bot[bot] wants to merge 4 commits into
mainfrom
subduing-spearing-cheery
Open

fix(voice): keep realtime turn after chat ctx timeout#2083
rosetta-livekit-bot[bot] wants to merge 4 commits into
mainfrom
subduing-spearing-cheery

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports Python PR #4972 (fix(realtime): report errors to SpeechHandle when update_chat_ctx fails) to Node.js.

When OpenAI Realtime updateChatCtx times out (or otherwise throws RealtimeError), AgentActivity now:

  1. Marks the corresponding SpeechHandle with that error via SpeechHandle._markException
  2. Emits ErrorEvent so the session can surface it
  3. Ensures session.run() / RunResult rejects with that error (Python _error parity) instead of returning a successful empty run

Also documents the public RealtimeError and SpeechHandle.exception() APIs for TypeDoc.

Follow-up fixes (post Rosetta review)

  • TypeDoc comments for RealtimeError and SpeechHandle.exception()
  • RunResult._markDone now rejects when SpeechHandle.exception() is set (Python session.run() / _error parity)
  • Unit coverage in speech_handle.test.ts and run_result.test.ts
  • Devin TypeDoc threads resolved
  • Merged latest main after CI flake on LiveKit inference (4be6aaef)

Cue verification

  • Session: sid_015f53d04968 (OpenAI Realtime temporary worker)
  • Artifacts: ~/.cue-cli/sessions/sid_015f53d04968/
  • Timeout / SpeechHandle exception path covered by Vitest (not Cue)

Test plan

  • Focused Vitest: speech_handle / run_result / agent_activity (48 passed)
  • CI Test green
  • verified-port added

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner July 22, 2026 03:57
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4be6aae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from longcw July 22, 2026 03:57
devin-ai-integration[bot]

This comment was marked as resolved.

toubatbrian and others added 3 commits July 22, 2026 12:31
Add TypeDoc for RealtimeError and SpeechHandle.exception, and reject
RunResult when the last SpeechHandle completed with an error so
session.run() matches Python SpeechHandle._error propagation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant